<script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>
<form action="index.php?top=page&option=com_frcenter" method="post" name="adminForm" id="adminForm">
<!-- LEFT -->
 <?php echo $this->loadTemplate('search','default') ?>
 <!-- END LEFT -->
 
 <!-- CONTENT -->
 <div id="jm-content">
    <?php $rows = $this->rows; 
    ?>
    <h3 class="jm-title" style="position: relative;">
        <label class="jm_name">
            <?php
            if($this->sr=='1')
            {
                echo '検索結果';
            }
            else echo '新着情報';
            ?>
        
        </label>
        <button style="float: right;position:absolute;right:5px;top:1px;" id="icon">アイコン説明</button></h3>
    <div class="">
    <?php 
        if(!empty($rows)){ 
        foreach($rows as $value){
    ?>
        <div class="cc">
            <h2 style="position: relative;">
                <span class="id-cc"><?php echo $value->OCBA_CODE; ?></span>
               	    <?php echo $value->OCBA_NAME; ?>
                <span style="float: right;position:absolute;right:5px;top:1px;">
                    <button href="index.php?top=page&option=com_frcenter&task=detail&id=<?php echo $value->OCBA_CODE; ?>" style="text-decoration: none;margin-top:1px;">詳細情報へ</button>
                </span>
            </h2>
            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                <tbody>
                <tr>
                    <td width="100" style="vertical-align:top"><?php if($value->OCBA_POST!=null) echo '〒'.$value->OCBA_POST; ?></td>
                    <td width="340" colspan="2"><?php echo $value->OCBA_ADD1;echo "<br/>".$value->OCBA_ADD2; ?></td>
                    <td width="180">
                    <?php
                        if($value->POOL_POHK == 1) {
                            echo '<img src="components/com_frcenter/public/images/pett_hot.gif" class="icon">';
                        }
                        elseif($value->POOL_POHK == 2) {
                            echo '<img src="components/com_frcenter/public/images/pett_heat.gif" class="icon">';
                        }
                        elseif(isset($value->POOL_OCBA_CODE)){
                            echo '<img src="components/com_frcenter/public/images/pett_pool.gif" class="icon"/>';                            
                        }
                    ?>
                    <?php
                        if(isset($value->GYMT_OCBA_CODE)){
                            echo '<img src="components/com_frcenter/public/images/pett_phys.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->DOCK_DOCM_CODE == 2){
                            echo '<img src="components/com_frcenter/public/images/pett_mini.gif" class="icon"/>';
                        }
                        elseif(isset($value->DOCK_OCBA_CODE)){
                            echo '<img src="components/com_frcenter/public/images/pett_boat.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_PUTF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_putf.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_LARF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_larf.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_CANF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_canf.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_YACF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_yacf.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_SCHF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_schf.gif" class="icon"/>';
                        }
                    ?>
                    <?php
                        if($value->OCBA_OUTF == 1){
                            echo '<img src="components/com_frcenter/public/images/ocba_outf.gif" class="icon"/>';
                        }
                    ?>
                        
                    </td>
                </tr>
                <!--
                <tr>
                    <td style="width: 20%;"></td>
                    <td colspan="3"><?php echo $value->OCBA_ADD2; ?></td>
                    
                </tr>
                -->
                <tr>
                    <td style="width: 20%;"></td>
                    <td style="width: 25%;"><?php if(!empty($value->OCBA_TEL)){ ?>Tel：<?php echo $value->OCBA_TEL; } ?></td>
                    <td style="width: 25%;"><?php if(!empty($value->OCBA_FAX)){ ?>Fax：<?php echo $value->OCBA_FAX; } ?></td>
                    <td style="width: 30%;"></td>
                </tr>
                
                </tbody>
            </table>
            <hr/>
            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                <tbody>
                <tr>
                    <td colspan="4"><strong><?php echo $value->OCBA_LNAME; ?></strong></td>
                </tr>
                <tr style="vertical-align:top">
                    <td width="100"><?php if($value->OCBA_LPOST!=null) echo '〒'.$value->OCBA_LPOST; ?></td>
                    <td width="340" colspan="2"><?php echo $value->OCBA_LADD1;echo "<br/>".$value->OCBA_LADD2; ?></td>
                </tr>
                <!--
                <tr>
                    <td style="width: 20%;"></td>
                    <td colspan="3"><?php echo $value->OCBA_LADD2; ?></td>
                    
                </tr>
                -->
                <tr>
                    <td style="width: 20%;"></td>
                    <td style="width: 25%;"><?php if(!empty($value->OCBA_LTEL)){ ?>Tel：<?php echo $value->OCBA_LTEL; } ?></td>
                    <td style="width: 25%;"><?php if(!empty($value->OCBA_LFAX)){ ?>Fax：<?php echo $value->OCBA_LFAX; } ?></td>
                    <td style="width: 30%;"></td>
                </tr>
                
                </tbody>
            </table>
            
        </div>
    
    <?php
        }
    } else
    {
        echo "<center>該当する検索結果は，存在しませんでした。検索条件を変えて検索してください。</center>";
    }
    ?>
    
        <table style="margin: auto;">
            <tfoot>
    			<tr>
    				<td colspan="15" style="text-align: center;">
    				    <?php echo $this->pagination->getListFooter(); ?>	
                    </td>
    			</tr>
    		</tfoot>
        </table>
        <input type="hidden" name="task" value=""/>
        <input type="hidden" name="boxchecked" value="0"/>
    
    </div>
 
    
 </div>
 <!-- END RIGHT -->
 
    <input type="hidden" name="task" value="" />
</form>

<script>
    jq(document).ready(function() {
        
        // show a dialog box when clicking on a link
        jq('#icon').bind('click', function(e) {
            e.preventDefault();
            jq.Zebra_Dialog('', {
                source:  {'ajax': 'index.php?top=page&option=com_frcenter&task=icon&tmpl=component'},
                height: 500,
                width: 500,
                title:  '【アイコン】ページ',
                type:  '',

            });
        });
        
        
        
    })
</script>